[SPARK-57724][SQL] Add missing error class MISSING_CLAUSES_FOR_OPERATION#56827
Open
anew wants to merge 1 commit into
Open
[SPARK-57724][SQL] Add missing error class MISSING_CLAUSES_FOR_OPERATION#56827anew wants to merge 1 commit into
anew wants to merge 1 commit into
Conversation
SPARK-54405 (METRIC VIEW) introduced error handling that throws the `MISSING_CLAUSES_FOR_OPERATION` error class from `QueryParsingErrors.missingClausesForOperation`, but never registered it in `error-conditions.json`. Register the error condition so the error class resolves correctly through the error-handling framework. Co-authored-by: Isaac
Member
| }, | ||
| "sqlState" : "0A000" | ||
| }, | ||
| "MISSING_CLAUSES_FOR_OPERATION" : { |
Contributor
There was a problem hiding this comment.
thank you for fixing. can you please add a test case for this?
Contributor
Author
There was a problem hiding this comment.
I am not sure how to test this... can you point me to an example of a test for one of the other error classes?
Contributor
There was a problem hiding this comment.
can you try sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala and add
test("xxx") {
val query =
"""CREATE VIEW mv
|LANGUAGE YAML
|AS
|$$
|version: 0.1
|$$""".stripMargin
checkError(
exception = parseException(query),
condition = "MISSING_CLAUSES_FOR_OPERATION",
sqlState = "42601",
parameters = Map(
"clauses" -> "WITH METRICS",
"operation" -> "METRIC VIEW CREATION"),
context = ExpectedContext(
fragment = query,
start = 0,
stop = query.length - 1))
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
SPARK-54405 (METRIC VIEW) introduced error handling that throws the
MISSING_CLAUSES_FOR_OPERATIONerror class fromQueryParsingErrors.missingClausesForOperation, but never registered it inerror-conditions.json. Register the error condition so the error class resolves correctly through the error-handling framework.Why are the changes needed?
This error class was used but not declared.
Does this PR introduce any user-facing change?
No
How was this patch tested?
No tests
Generated-by: Opus 4.8